<?php if($category->num_rows() > 0):?>
<ul>
<?php if( isset($find) && ($find>1) ):?>
    <li class="sort-category" data-level="<?php echo isset($level)?$level:'';?>" data-cid="<?php echo isset($parent_id)?$parent_id:'';?>"  data-parent="<?php echo isset($parent_id)?$parent_id:'';?>"  <?php if($level==1):?>data-find="1"<?php else:?>data-find="2"<?php endif;?>>
       返回上一级
    </li>
<?php endif;?>
<?php foreach( $category->result() as $key=>$value ):?>
    <li class="sort-category <?php if($cid == $value->id):?>active<?php endif;?>" data-level="<?php echo $value->level ?>" data-cid="<?php echo $value->id ?>" data-parent="<?php echo $value->parent_id;?>"><?php echo $value->name;?></li>
<?php endforeach; ?>
</ul>
<?php endif;?>